<?php
/**
 * @return
 * @author 朱乐斌
 * @date
 */

namespace app\api\model;

use think\Model;

class SensitiveWordModel extends Model
{

    protected $table = "gx_sensitive_word";


    // 检查内容是否带有敏感字
    public static function postSensitiveWord(array $date):bool
    {
        $model = new SensitiveWordModel();
        $model = $model->select();
        $abs = [];
        foreach ($model as $item){
            $abs[] = $item['badword'];
        }
        foreach ($abs as $item){
            if (strpos($date['content'],$item) !== false){
                return true;
                break;
            }
        }
        return false;
    }


}